import request from '@/utils/request';
import Constants from '@/utils/constants';

/** 获取列表 POST  */
export async function getAuthList(options?: { [key: string]: any }) {
  return request<API.BaseRes>(`${Constants.SERVICE_ROOT}/auth/configuration/list`, {
    method: 'GET',
    ...(options || {}),
  });
}

/** 获取详情 GET  */
export async function authInfo(params: any) {
  return request<API.BaseRes>(`${Constants.SERVICE_ROOT}/auth/configuration/info`, {
    method: 'GET',
    params: {
      ...params,
    },
  });
}


/** 更新 PUT */
export async function updateAuth(params:any) {
  return request<API.BaseRes>(`${Constants.SERVICE_ROOT}/auth/configuration/info`, {
    method: 'PUT',
    data: {
      ...params,
    },
  });
}

/** 删除 DELETE */
export async function delAuth(params:any) {
  return request<API.BaseRes>(`${Constants.SERVICE_ROOT}/auth/configuration/info`, {
    method: 'DELETE',
    data: {
      ...params,
    },
  });
}


/** 新建 POST */
export async function addAuth(params:any) {
  return request<API.BaseRes>(`${Constants.SERVICE_ROOT}/auth/configuration/info`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
